package com.zxl.util;

import java.util.UUID;

public class CreateUUID {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		UUID uuid = UUID.randomUUID();
		String temp = "";
		long st = System.currentTimeMillis();
		for(int i = 0; i < 1000000; i++){
//			temp = createUUID(); //100W用时1387毫秒
			temp = uuid.randomUUID().toString(); //100W用时4385毫秒
//			System.out.println("uuid:" + temp);
		}
		long et = System.currentTimeMillis();
		System.out.println("用时:" + (et - st));
	}

	/**
	 * 生成UUID
	 * @return
	 */
	public static String createUUID(){
		return new com.eaio.uuid.UUID().toString();
	}
}
